var publicObj = {
    init: function() {
        this.downApp();
        this.share();
    },
    //下载信息
    downApp: function() {
        var str = '<div class="downbox downlogo"></div><div class="downbox downtip1">如e购</div><div class="downbox downtip2">购物不排队、拼团享优惠</div><div class="downbox downnow">立即抢</div>'
        $(".downappbox").html(str);
        $(".downnow").bind("click", function() {
            var u = navigator.userAgent;
            if (u.indexOf('Android') > -1 || u.indexOf('Linux') > -1) {
                location.href = 'http://a.app.qq.com/o/simple.jsp?pkgname=com.rongxwy.ruezhifu';
            } else if (u.indexOf('iPhone') > -1) {
                location.href = 'https://itunes.apple.com/cn/app/%E5%A6%82e%E6%94%AF%E4%BB%98/id1182876375?mt=8';
            }
        })
    },
    //获得链接参数
    getUrlData: function(name) {
        var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
        var r = window.location.search.substr(1).match(reg);
        if (r != null) return unescape(r[2]);
        return null;
    },
    //弹窗相关
    makeLayerDom: function() {
        var dom = '<div class="l_o_wall"><div class="l_o_layer"></div><div class="l_o_tip"></div></div>';
        $("body").append(dom)
    },
    showLayer: function(tip) {
        $(".l_o_wall").show();
        $(".l_o_tip").text(tip);
        var int
        clearTimeout(int)
        int = setTimeout(function() {
            $(".l_o_wall").hide()
        }, 800);

    },
    //分享
    share: function() {
        $(".share").bind("click", function() {
            $(".layerbox").show();
            $(".sharebox").show();
        })
        $(".sharebox").bind("click", function() {
            $(".layerbox").hide();
            $(".sharebox").hide();
        })
    }
}
publicObj.init();